<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function goBack(){
				history.back();
			}
			function findLocation(){
				alert("协议："+window.location.protocol);
				alert("端口："+window.location.port);
				alert("主机："+window.location.host);
				alert("主机："+window.location.hostname);
				alert("完整地址："+location.href);
				alert("路径部分："+window.location.pathname);
				alert("hash:"+location.hash);
				alert("查询字符串？"+location.search);
			}
			function repNew(){
				window.location.reload();
				alert("刷新完成");
				//window.location="https://www.baidu.com";
				//window.location.replace("https://www.baidu.com");
				window.location.assign("https://www.baidu.com");
			}
		</script>
	</head>
	<body>
		<input type="button" value="后退" onclick="goBack()"/>
		<input type="button" value="获得地址信息" ondblclick="findLocation()"/>
		<input type="button" value="替换为baidu.com" onclick="repNew()"/>
	</body>
</html>
